﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Services;

namespace DragDropProto2
{
    public partial class DD_Proto2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Song[] songlist = new Song[22];
                songlist[0] = new Song("Mustang Sally", "C", "Natalie", 180);
                songlist[1] = new Song("Get Ready", "G", "Sophia", 204);
                songlist[2] = new Song("Signed Sealed Delivered", "C", "Norm/Nat", 240);
                songlist[3] = new Song("Rolling in the Deep", "F", "Sophia", 180);
                songlist[4] = new Song("Are You Gonna Go My Way", "Eb", "Norm", 150);
                songlist[5] = new Song("Hella Good", "Ab", "Natalie", 210);
                songlist[6] = new Song("Soul Man", "Bb", "Jay", 230);
                songlist[7] = new Song("Please Don't Stop The Music / Mamma Say", "F", "Soph/Nat", 280);
                songlist[8] = new Song("Gimme Some Lovin", "E", "Will", 180);
                songlist[9] = new Song("I Want You Back", "G", "Nat", 180);
                songlist[10] = new Song("Tell Me Something Good", "Eb", "Nat", 210);
                songlist[11] = new Song("Superstition", "Fm", "Will", 220);
                songlist[12] = new Song("Don't Stop Believin", "E", "Nat/Sophia", 310);
                songlist[13] = new Song("You Shook Me All Night Long", "G", "Sophia", 230);
                songlist[14] = new Song("I Got A Feeling", "G", "Natalie", 180);
                songlist[15] = new Song("I Love RocknRoll/ We will Rock U", "C", "Sophia", 290);
                songlist[16] = new Song("Brick House", "Am", "Natalie", 190);
                songlist[17] = new Song("Lady Marmalade", "Gm", "Natalie", 170);
                songlist[18] = new Song("Raise Your Glass", "D", "Sophia", 210);
                songlist[19] = new Song("Only Girl In The World", "A", "Natalie", 170);
                songlist[20] = new Song("Grenade (Bruno Mars)", "E", "Sophia", 220);
                songlist[21] = new Song("Think", "C", "Natalie", 200);


                Songs.DataSource = songlist;
                Songs.DataBind();
            }

        }
        [WebMethod(Description="Saves List Order Temporarily", EnableSession=true)]
        // Set session state value.
        public static string PersistList(string key, string value)
        {
            HttpContext.Current.Session[key] = value;
            return (string)HttpContext.Current.Session[key];
        }

        [WebMethod(Description = "Retrieves List Order", EnableSession = true)]
        public static string RetrieveList(string key)
        {
            return (string)HttpContext.Current.Session[key];
        }
    }
}